﻿using ActivitiesPlan.domain;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ActivitiesPlan.dao {
    class ActivityDao {

        public List<Activity> getAllActivities() {
            List<Activity> activities = new List<Activity>();

            String line;
            System.IO.StreamReader file = new System.IO.StreamReader(@"C:\Users\mpodda\Documents\Private\Activities.txt");

            while ((line = file.ReadLine()) != null) {
                Activity activity = new Activity();
                String[] parts = line.Split(';');
                activity.Id = parts[0];
                activity.Description = parts[1];

                activities.Add(activity);
            }

            file.Close();

            return activities;
        }
    }
}
